package test.spring;

import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
 
public class GracefulShutdown {
    public static void main(String[] args) {
        try {
            URL url = new URL("http://localhost:8349/actuator/shutdown");
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.connect();
            System.out.println("Shutdown request sent");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}